require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '10.0'

# Not from original react-native: Don't show warnings from dependencies
inhibit_all_warnings!

target 'RNStateMuseum' do
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

  target 'RNStateMuseumTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  use_flipper!
  post_install do |installer|
    # Not from original react-native:
    # Some of the dependencies have a deployment target lower then 9.0
    # pushing these to 9.0 removes some warnings
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        if Gem::Version.new('9.0') > Gem::Version.new(config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'])
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
        end
      end
    end

    flipper_post_install(installer)
  end
end

target 'RNStateMuseum-tvOS' do
  # Pods for RNStateMuseum-tvOS

  target 'RNStateMuseum-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end
